package com.admin.business.venueProjectCommercialTenantSet;

import com.tiangong.framework.annotation.OpenApi;
import com.tiangong.framework.bo.CDO;
import com.tiangong.framework.bo.Return;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

/**
 * @description: 商户表
 * @create: 2022-05-26 18:46:06
 **/
@Service("venueProjectCommercialTenantSet")
@Slf4j
public class VenueProjectCommercialTenantSetService {

    @Resource
    VenueProjectCommercialTenantSetDao venueProjectCommercialTenantSetDao;


    @OpenApi
    public Return addVenueProjectCommercialTenantSet(CDO cdoRequest) {
        CDO cdoResult = new CDO();
        //校验是否存在相同名称
        CDO result = venueProjectCommercialTenantSetDao.getVenueProjectCommercialTenantSet(cdoRequest);
        if(result!=null){
            venueProjectCommercialTenantSetDao.venueProjectCommercialTenantUpdateSet(cdoRequest);
        }else{
            venueProjectCommercialTenantSetDao.venueProjectCommercialTenantAddSet(cdoRequest);
        }

        return Return.valueOf(cdoRequest);
    }

    @OpenApi
    public Return getVenueProjectCommercialTenantSet(CDO cdoRequest) {
        CDO result = venueProjectCommercialTenantSetDao.getVenueProjectCommercialTenantSet(cdoRequest);
        CDO cdoResult = new CDO();
        cdoResult.set("data",result);
        return Return.valueOf(result);
    }

}
